<template>
  <div>
    <input @keydown.enter="fn" type="text">
    <input @keydown.13="fn" type="text">
    <input @keydown.esc="fn2" type="text">
  </div>
</template>

<script>
export default {
  data() {
    return {
      
    };
  },
  methods: {
    fn() {
      console.log('被按下了回车键');
    },
    fn2() {
      console.log('被按下了esc键');
    }
   
  },
};
</script>

<style>

</style>